// 审批状态枚举
export enum ApprovalStatus {
  PENDING = 'pending',
  APPROVED = 'approved',
  REJECTED = 'rejected',
  TRANSFERRED = 'transferred'
}

// 添加状态显示文本映射
export const ApprovalStatusText = {
  [ApprovalStatus.PENDING]: '待审批',
  [ApprovalStatus.APPROVED]: '已同意',
  [ApprovalStatus.REJECTED]: '已拒绝',
  [ApprovalStatus.TRANSFERRED]: '已转交'
};

// 添加状态样式类映射
export const ApprovalStatusClass = {
  [ApprovalStatus.PENDING]: 'pending',
  [ApprovalStatus.APPROVED]: 'approved',
  [ApprovalStatus.REJECTED]: 'rejected',
  [ApprovalStatus.TRANSFERRED]: 'transferred'
};

// 表单字段值类型
export interface FormFieldValue {
  key: string;
  label: string;
  value: any;
  type: 'text' | 'textarea' | 'number' | 'date' | 'select';
  options?: Array<{ value: string; label: string }>;
}

// 审批基础信息
export interface ApprovalBase {
  id: string;
  type: number;
  typeName: string;
  creator: {
    id: string;
    name: string;
  };
  createTime: string;
  status: ApprovalStatus;
  currentApprover: {
    id: string;
    name: string;
  };
}

// 审批数据
export interface Approval extends ApprovalBase {
  fields: FormFieldValue[];
  approvalHistory: Array<{
    operatorId: string;
    operatorName: string;
    operation: ApprovalStatus;
    comment: string;
    operateTime: string;
  }>;
}

// 审批类型
export interface ApprovalType {
  id: number;
  name: string;
  icon: string;
  fields: FormField[];
} 